package com.itheima.多态.多态的弊端_05;
//动物类--父类
public abstract class Anmial {
    public abstract void eat();
}
//狗类--子类
class Dog extends Anmial {

    @Override
    public void eat() {
        System.out.println("狗吃肉");
    }

    public void lookHome() {
        System.out.println("狗狗会看家");
    }
}
//猫类--子类
    class Cat extends Anmial {

        @Override
        public void eat() {
            System.out.println("狗吃肉");
        }

        public void lookHome() {
            System.out.println("狗狗会看家");
        }
    }
